3.1.5 \(\int \frac {a+a \cot (c+d x)}{\sqrt {e \cot (c+d x)}} \, dx\) [5]

Optimal. Leaf size=49 \[ \frac {\sqrt {2} a \text {ArcTan}\left (\frac {\sqrt {e} (1-\cot (c+d x))}{\sqrt {2} \sqrt {e \cot (c+d x)}}\right )}{d \sqrt {e}} \]

[Out]

a*arctan(1/2*(1-cot(d*x+c))*e^(1/2)*2^(1/2)/(e*cot(d*x+c))^(1/2))*2^(1/2)/d/e^(1/2)

________________________________________________________________________________________

Rubi [A]
time = 0.03, antiderivative size = 49, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.087, Rules used = {3613, 211} \begin {gather*} \frac {\sqrt {2} a \text {ArcTan}\left (\frac {\sqrt {e} (1-\cot (c+d x))}{\sqrt {2} \sqrt {e \cot (c+d x)}}\right )}{d \sqrt {e}} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(a + a*Cot[c + d*x])/Sqrt[e*Cot[c + d*x]],x]

[Out]

(Sqrt[2]*a*ArcTan[(Sqrt[e]*(1 - Cot[c + d*x]))/(Sqrt[2]*Sqrt[e*Cot[c + d*x]])])/(d*Sqrt[e])

Rule 211

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]/a)*ArcTan[x/Rt[a/b, 2]], x] /; FreeQ[{a, b}, x]
&& PosQ[a/b]

Rule 3613

Int[((c_) + (d_.)*tan[(e_.) + (f_.)*(x_)])/Sqrt[(b_.)*tan[(e_.) + (f_.)*(x_)]], x_Symbol] :> Dist[-2*(d^2/f),
Subst[Int[1/(2*c*d + b*x^2), x], x, (c - d*Tan[e + f*x])/Sqrt[b*Tan[e + f*x]]], x] /; FreeQ[{b, c, d, e, f}, x
] && EqQ[c^2 - d^2, 0]

Rubi steps

\begin {align*} \int \frac {a+a \cot (c+d x)}{\sqrt {e \cot (c+d x)}} \, dx &=-\frac {\left (2 a^2\right ) \text {Subst}\left (\int \frac {1}{-2 a^2-e x^2} \, dx,x,\frac {a-a \cot (c+d x)}{\sqrt {e \cot (c+d x)}}\right )}{d}\\ &=\frac {\sqrt {2} a \tan ^{-1}\left (\frac {\sqrt {e} (1-\cot (c+d x))}{\sqrt {2} \sqrt {e \cot (c+d x)}}\right )}{d \sqrt {e}}\\ \end {align*}

________________________________________________________________________________________

Mathematica [C] Result contains higher order function than in optimal. Order 5 vs. order 3 in optimal.
time = 0.22, size = 165, normalized size = 3.37 \begin {gather*} \frac {a \left (3 \sqrt {2} \left (-2 \text {ArcTan}\left (1-\sqrt {2} \sqrt {\tan (c+d x)}\right )+2 \text {ArcTan}\left (1+\sqrt {2} \sqrt {\tan (c+d x)}\right )-\log \left (1-\sqrt {2} \sqrt {\tan (c+d x)}+\tan (c+d x)\right )+\log \left (1+\sqrt {2} \sqrt {\tan (c+d x)}+\tan (c+d x)\right )\right )+8 \, _2F_1\left (\frac {3}{4},1;\frac {7}{4};-\tan ^2(c+d x)\right ) \tan ^{\frac {3}{2}}(c+d x)\right )}{12 d \sqrt {e \cot (c+d x)} \sqrt {\tan (c+d x)}} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(a + a*Cot[c + d*x])/Sqrt[e*Cot[c + d*x]],x]

[Out]

(a*(3*Sqrt[2]*(-2*ArcTan[1 - Sqrt[2]*Sqrt[Tan[c + d*x]]] + 2*ArcTan[1 + Sqrt[2]*Sqrt[Tan[c + d*x]]] - Log[1 -
Sqrt[2]*Sqrt[Tan[c + d*x]] + Tan[c + d*x]] + Log[1 + Sqrt[2]*Sqrt[Tan[c + d*x]] + Tan[c + d*x]]) + 8*Hypergeom
etric2F1[3/4, 1, 7/4, -Tan[c + d*x]^2]*Tan[c + d*x]^(3/2)))/(12*d*Sqrt[e*Cot[c + d*x]]*Sqrt[Tan[c + d*x]])

________________________________________________________________________________________

Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(272\) vs. \(2(40)=80\).
time = 0.49, size = 273, normalized size = 5.57

method result size
derivativedivides \(-\frac {a \left (\frac {\left (e^{2}\right )^{\frac {1}{4}} \sqrt {2}\, \left (\ln \left (\frac {e \cot \left (d x +c \right )+\left (e^{2}\right )^{\frac {1}{4}} \sqrt {e \cot \left (d x +c \right )}\, \sqrt {2}+\sqrt {e^{2}}}{e \cot \left (d x +c \right )-\left (e^{2}\right )^{\frac {1}{4}} \sqrt {e \cot \left (d x +c \right )}\, \sqrt {2}+\sqrt {e^{2}}}\right )+2 \arctan \left (\frac {\sqrt {2}\, \sqrt {e \cot \left (d x +c \right )}}{\left (e^{2}\right )^{\frac {1}{4}}}+1\right )-2 \arctan \left (-\frac {\sqrt {2}\, \sqrt {e \cot \left (d x +c \right )}}{\left (e^{2}\right )^{\frac {1}{4}}}+1\right )\right )}{4 e}+\frac {\sqrt {2}\, \left (\ln \left (\frac {e \cot \left (d x +c \right )-\left (e^{2}\right )^{\frac {1}{4}} \sqrt {e \cot \left (d x +c \right )}\, \sqrt {2}+\sqrt {e^{2}}}{e \cot \left (d x +c \right )+\left (e^{2}\right )^{\frac {1}{4}} \sqrt {e \cot \left (d x +c \right )}\, \sqrt {2}+\sqrt {e^{2}}}\right )+2 \arctan \left (\frac {\sqrt {2}\, \sqrt {e \cot \left (d x +c \right )}}{\left (e^{2}\right )^{\frac {1}{4}}}+1\right )-2 \arctan \left (-\frac {\sqrt {2}\, \sqrt {e \cot \left (d x +c \right )}}{\left (e^{2}\right )^{\frac {1}{4}}}+1\right )\right )}{4 \left (e^{2}\right )^{\frac {1}{4}}}\right )}{d}\) \(273\)
default \(-\frac {a \left (\frac {\left (e^{2}\right )^{\frac {1}{4}} \sqrt {2}\, \left (\ln \left (\frac {e \cot \left (d x +c \right )+\left (e^{2}\right )^{\frac {1}{4}} \sqrt {e \cot \left (d x +c \right )}\, \sqrt {2}+\sqrt {e^{2}}}{e \cot \left (d x +c \right )-\left (e^{2}\right )^{\frac {1}{4}} \sqrt {e \cot \left (d x +c \right )}\, \sqrt {2}+\sqrt {e^{2}}}\right )+2 \arctan \left (\frac {\sqrt {2}\, \sqrt {e \cot \left (d x +c \right )}}{\left (e^{2}\right )^{\frac {1}{4}}}+1\right )-2 \arctan \left (-\frac {\sqrt {2}\, \sqrt {e \cot \left (d x +c \right )}}{\left (e^{2}\right )^{\frac {1}{4}}}+1\right )\right )}{4 e}+\frac {\sqrt {2}\, \left (\ln \left (\frac {e \cot \left (d x +c \right )-\left (e^{2}\right )^{\frac {1}{4}} \sqrt {e \cot \left (d x +c \right )}\, \sqrt {2}+\sqrt {e^{2}}}{e \cot \left (d x +c \right )+\left (e^{2}\right )^{\frac {1}{4}} \sqrt {e \cot \left (d x +c \right )}\, \sqrt {2}+\sqrt {e^{2}}}\right )+2 \arctan \left (\frac {\sqrt {2}\, \sqrt {e \cot \left (d x +c \right )}}{\left (e^{2}\right )^{\frac {1}{4}}}+1\right )-2 \arctan \left (-\frac {\sqrt {2}\, \sqrt {e \cot \left (d x +c \right )}}{\left (e^{2}\right )^{\frac {1}{4}}}+1\right )\right )}{4 \left (e^{2}\right )^{\frac {1}{4}}}\right )}{d}\) \(273\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+a*cot(d*x+c))/(e*cot(d*x+c))^(1/2),x,method=_RETURNVERBOSE)

[Out]

-1/d*a*(1/4/e*(e^2)^(1/4)*2^(1/2)*(ln((e*cot(d*x+c)+(e^2)^(1/4)*(e*cot(d*x+c))^(1/2)*2^(1/2)+(e^2)^(1/2))/(e*c
ot(d*x+c)-(e^2)^(1/4)*(e*cot(d*x+c))^(1/2)*2^(1/2)+(e^2)^(1/2)))+2*arctan(2^(1/2)/(e^2)^(1/4)*(e*cot(d*x+c))^(
1/2)+1)-2*arctan(-2^(1/2)/(e^2)^(1/4)*(e*cot(d*x+c))^(1/2)+1))+1/4/(e^2)^(1/4)*2^(1/2)*(ln((e*cot(d*x+c)-(e^2)
^(1/4)*(e*cot(d*x+c))^(1/2)*2^(1/2)+(e^2)^(1/2))/(e*cot(d*x+c)+(e^2)^(1/4)*(e*cot(d*x+c))^(1/2)*2^(1/2)+(e^2)^
(1/2)))+2*arctan(2^(1/2)/(e^2)^(1/4)*(e*cot(d*x+c))^(1/2)+1)-2*arctan(-2^(1/2)/(e^2)^(1/4)*(e*cot(d*x+c))^(1/2
)+1)))

________________________________________________________________________________________

Maxima [A]
time = 0.51, size = 57, normalized size = 1.16 \begin {gather*} -\frac {{\left (\sqrt {2} \arctan \left (\frac {1}{2} \, \sqrt {2} {\left (\sqrt {2} + \frac {2}{\sqrt {\tan \left (d x + c\right )}}\right )}\right ) + \sqrt {2} \arctan \left (-\frac {1}{2} \, \sqrt {2} {\left (\sqrt {2} - \frac {2}{\sqrt {\tan \left (d x + c\right )}}\right )}\right )\right )} a e^{\left (-\frac {1}{2}\right )}}{d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+a*cot(d*x+c))/(e*cot(d*x+c))^(1/2),x, algorithm="maxima")

[Out]

-(sqrt(2)*arctan(1/2*sqrt(2)*(sqrt(2) + 2/sqrt(tan(d*x + c)))) + sqrt(2)*arctan(-1/2*sqrt(2)*(sqrt(2) - 2/sqrt
(tan(d*x + c)))))*a*e^(-1/2)/d

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 82 vs. \(2 (32) = 64\).
time = 4.41, size = 82, normalized size = 1.67 \begin {gather*} \frac {\sqrt {2} a \arctan \left (-\frac {{\left (\sqrt {2} \cos \left (2 \, d x + 2 \, c\right ) - \sqrt {2} \sin \left (2 \, d x + 2 \, c\right ) + \sqrt {2}\right )} \sqrt {\frac {\cos \left (2 \, d x + 2 \, c\right ) + 1}{\sin \left (2 \, d x + 2 \, c\right )}}}{2 \, {\left (\cos \left (2 \, d x + 2 \, c\right ) + 1\right )}}\right ) e^{\left (-\frac {1}{2}\right )}}{d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+a*cot(d*x+c))/(e*cot(d*x+c))^(1/2),x, algorithm="fricas")

[Out]

sqrt(2)*a*arctan(-1/2*(sqrt(2)*cos(2*d*x + 2*c) - sqrt(2)*sin(2*d*x + 2*c) + sqrt(2))*sqrt((cos(2*d*x + 2*c) +
 1)/sin(2*d*x + 2*c))/(cos(2*d*x + 2*c) + 1))*e^(-1/2)/d

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} a \left (\int \frac {1}{\sqrt {e \cot {\left (c + d x \right )}}}\, dx + \int \frac {\cot {\left (c + d x \right )}}{\sqrt {e \cot {\left (c + d x \right )}}}\, dx\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+a*cot(d*x+c))/(e*cot(d*x+c))**(1/2),x)

[Out]

a*(Integral(1/sqrt(e*cot(c + d*x)), x) + Integral(cot(c + d*x)/sqrt(e*cot(c + d*x)), x))

________________________________________________________________________________________

Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+a*cot(d*x+c))/(e*cot(d*x+c))^(1/2),x, algorithm="giac")

[Out]

integrate((a*cot(d*x + c) + a)/sqrt(e*cot(d*x + c)), x)

________________________________________________________________________________________

Mupad [B]
time = 0.73, size = 65, normalized size = 1.33 \begin {gather*} \frac {{\left (-1\right )}^{1/4}\,a\,\mathrm {atan}\left (\frac {{\left (-1\right )}^{1/4}\,\sqrt {e\,\mathrm {cot}\left (c+d\,x\right )}}{\sqrt {e}}\right )\,\left (-1+1{}\mathrm {i}\right )}{d\,\sqrt {e}}+\frac {{\left (-1\right )}^{1/4}\,a\,\mathrm {atanh}\left (\frac {{\left (-1\right )}^{1/4}\,\sqrt {e\,\mathrm {cot}\left (c+d\,x\right )}}{\sqrt {e}}\right )\,\left (1+1{}\mathrm {i}\right )}{d\,\sqrt {e}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + a*cot(c + d*x))/(e*cot(c + d*x))^(1/2),x)

[Out]

((-1)^(1/4)*a*atanh(((-1)^(1/4)*(e*cot(c + d*x))^(1/2))/e^(1/2))*(1 + 1i))/(d*e^(1/2)) - ((-1)^(1/4)*a*atan(((
-1)^(1/4)*(e*cot(c + d*x))^(1/2))/e^(1/2))*(1 - 1i))/(d*e^(1/2))

________________________________________________________________________________________